package com.bdqn.service;

import com.bdqn.mapper.SupplierMapper;
import com.bdqn.pojo.Supplier;
import com.bdqn.util.MyBatisUtil;

import java.util.List;

/**
 * SupplierServiceImpl
 *
 * @author LILIBO
 * @since 2021-09-15
 */
public class SupplierServiceImpl implements SupplierService {

    private SupplierMapper supplierMapper = MyBatisUtil.sqlSession.getMapper(SupplierMapper.class);

    /**
     * 分页获取供应商数据
     *
     * @param supplier 查询条件对象
     * @param pageIndex 第几页
     * @param pageSize 每页多少条
     * @return
     */
    @Override
    public List<Supplier> selectPageList(Supplier supplier, Integer pageIndex, Integer pageSize) {
        return supplierMapper.selectPageList(supplier, (pageIndex - 1) * pageSize, pageSize);
    }
}
